﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCLHShenPiXX_FH.ascx.cs" Inherits="Web.Controls.LAIHAN.UCLHShenPiXX_FH" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<style type="text/css">
    .tdMonthsNum {
        width: 6.3%;
    }

    .tdMonthsNum input {
        text-align: right;
    }

    .tdMonthsSpace {
        width: 0.5%;
    }

    .tdMonthsFirst {
        width: 12%;
    }

    .tdMonthsSum {
        width: 7%;
    }
</style>

<table border="0" style="width: 99%;max-width:920px;padding: 0px; line-height: 21.5px;" runat="server" id="tabTitle">
    <tr>
        <td class="tdMonthsFirst" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">1月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">2月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">3月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">4月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">5月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">6月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">7月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">8月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">9月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">10月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">11月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">12月</td>
        <td class="tdMonthsSpace" style="text-align:center"></td>
        <td class="tdMonthsNum" style="text-align:center">全年</td>
        <td></td>
    </tr>
</table>
<table id="tabYJiHua" runat="server" border="0" style="width: 99%;max-width:920px;">
    <tr>
        <td style="text-align:right" class="tdMonthsFirst">
            <dx:ASPxLabel ID="lblYJH" runat="server" Text="原计划："></dx:ASPxLabel>
        </td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM1" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM2" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM3" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM4" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM5" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM6" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM7" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM8" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM9" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM10" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM11" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsNum">
            <dx:ASPxTextBox ID="yjhM12" runat="server" Style="width: 100%" disabled="disabled" />
        </td>
        <td style="text-align:right" class="tdMonthsSpace"></td>
        <td style="text-align:left" class="tdMonthsSum">
            <dx:ASPxTextBox ID="yjhMSUM" runat="server" HorizontalAlign="Right" Style="width: 100%" disabled="disabled" />
        </td>
        <td rowspan="5"></td>
    </tr>
    <tr>
        <td style="text-align:right">
            <dx:ASPxLabel ID="lblSYL" runat="server" Text="近一年实用："></dx:ASPxLabel>
        </td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM1" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM2" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM3" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM4" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM5" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM6" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM7" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM8" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM9" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM10" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM11" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylM12" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
        <td style="text-align:right"></td>
        <td style="text-align:left">
            <dx:ASPxTextBox ID="sylMSUM" runat="server" disabled="disabled" HorizontalAlign="Right" ForeColor="#c0c0c0" Style="width: 100%" />
        </td>
    </tr>
</table>
<br/>
<dx:ASPxGridView ID="gvList" ClientInstanceName="gvList" runat="server" AutoGenerateColumns="False" Theme="Aqua1" Width="100%" KeyFieldName="S_YONGHUH" Visible="False">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="60" CellStyle-HorizontalAlign="Right" VisibleIndex="1">
<CellStyle HorizontalAlign="Right"></CellStyle>
            <FooterTemplate>
                <span>合计</span>
            </FooterTemplate>
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="120" VisibleIndex="2">
        </dx:GridViewDataTextColumn>
        <%--<dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="地址" Width="0">
        </dx:GridViewDataTextColumn>--%>
        <dx:GridViewDataTextColumn FieldName="I_M1" Caption="1月" Width="55" VisibleIndex="3">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M2" Caption="2月" Width="55" VisibleIndex="4">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M3" Caption="3月" Width="55" VisibleIndex="5">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M4" Caption="4月" Width="55" VisibleIndex="6">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M5" Caption="5月" Width="55" VisibleIndex="7">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M6" Caption="6月" Width="55" VisibleIndex="8">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M7" Caption="7月" Width="55" VisibleIndex="9">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M8" Caption="8月" Width="55" VisibleIndex="10">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M9" Caption="9月" Width="55" VisibleIndex="11">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M10" Caption="10月" Width="55" VisibleIndex="12">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M11" Caption="11月" Width="55" VisibleIndex="13">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M12" Caption="12月" Width="55" VisibleIndex="14">
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataTextColumn FieldName="I_M13" Caption="全年" Width="60" VisibleIndex="15">
        </dx:GridViewDataTextColumn>
    </Columns>
    <Settings VerticalScrollableHeight="100" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" ShowFooter="True"/><%-- ShowColumnHeaders="false"--%>
    <SettingsBehavior ColumnResizeMode="Control" />
    <TotalSummary>
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M1" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M2" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M3" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M4" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M5" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M6" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M7" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M8" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M9" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M11" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M10" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M12" SummaryType="Sum" />
        <dx:ASPxSummaryItem DisplayFormat="{0}" FieldName="I_M13" SummaryType="Sum" />
    </TotalSummary>
    <Styles>
        <Footer BackColor="#0099FF" ForeColor="White">
        </Footer>
    </Styles>
</dx:ASPxGridView>
 <table  id="tabEditFrmMain" style="width:auto;height:180px;">
        
    </table>
 <table  style="width:auto;height:29px;border:1px solid red;" >
        <tr>
            <td style="width:300px;border:1px solid black;text-align:center;">合计:</td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain1"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain2"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain3"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain4"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain5"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain6"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain7"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain8"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain9"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain10"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain11"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain12"></td>
            <td style="width:80px;border:1px solid black;text-align:center;" id="tdmain13"></td>
        </tr>
    </table>
<div id="frmEdit"></div>
<a href="#" id="btnEdit">修改</a>

<asp:TextBox ID="txtLX" runat="server" ReadOnly="True"></asp:TextBox>
<asp:TextBox ID="txtBH" runat="server" ReadOnly="True"></asp:TextBox>

<asp:Button ID="btnD" runat="server" Text="刷新" OnClick="btnD_Click" />


<script type="text/javascript" src="<%=ResolveUrl("../../JS/jquery-1.8.3.js")%>" ></script>
<script src="../../../EasyUI/jquery.min.js"></script>
    <script src="../../../EasyUI/jquery.easyui.min.js"></script>
    <link href="../../../EasyUI/themes/color.css" rel="stylesheet" />
    <link href="../../../EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="../../../EasyUI/themes/material/easyui.css" rel="stylesheet" />

<script type="text/jscript">
    $().ready(function () {
        $.ajaxSetup({
            async: false
        });
        $("#UCLHShenPiXX_FH_txtLX").css("display", "none");
        $("#UCLHShenPiXX_FH_txtBH").css("display", "none");
        $("#UCLHShenPiXX_FH_btnD").css("display", "none");
        $("#btnEdit").click(function () {
            var lx = $("#UCLHShenPiXX_FH_txtLX").val();
            var bh = $("#UCLHShenPiXX_FH_txtBH").val();
            $("#frmEdit").dialog({
                title: "修改",						//弹出界面的标题		
                width: 1000,
                height: 450,
                closed: false,
                cache: true,
                collapsible: true,
                href: "EditFrom.html",//弹出界面的url地址		
                queryParams: { lx: lx, bh: bh },
                modal: true					//是否是模态窗口	 
            });
        });

        var lx = $("#UCLHShenPiXX_FH_txtLX").val();
        var bh = $("#UCLHShenPiXX_FH_txtBH").val();
        var params = { lx: lx, bh: bh };
        //初始化加载
        $("#tabEditFrmMain").datagrid({
            url: "../../../ashx/EditDaiChuLi.ashx?type=show",
            queryParams: params,
            closed: false,
            cache: true,
            showFooter: false,
            rownumbers: false,
            fitColumns: true,
            singleSelect: true,
            columns: [[
                 { field: "S_YONGHUH", title: "用户号", width: 80 },
                 { field: "S_YONGHUM", title: "用户名", width: 220 },
                 {
                     field: "IM_1", title: "一月", width: 80
                 },
                 { field: "IM_2", title: "二月", width: 80 },
                 { field: "IM_3", title: "三月", width: 80 },
                 { field: "IM_4", title: "四月", width: 80 },
                 { field: "IM_5", title: "五月", width: 80 },
                 { field: "IM_6", title: "六月", width: 80 },
                 { field: "IM_7", title: "七月", width: 80 },
                 { field: "IM_8", title: "八月", width: 80 },
                 { field: "IM_9", title: "九月", width: 80 },
                 { field: "IM_10", title: "十月", width: 80 },
                 { field: "IM_11", title: "十一月", width: 80 },
                 { field: "IM_12", title: "十二月", width: 80 },
                 { field: "IM_13", title: "全年", width: 80 }
            ]]
        });
        //var trlist = "<tr ><td>合计</td><td></td><td>" + compute("IM_1") + "</td><td>" + compute("IM_2") + "</td><td>" + compute("IM_3") + "</td><td>" + compute("IM_4") + "</td><td>" + compute("IM_5") + "</td><td>" + compute("IM_6") + "</td><td>" + compute("IM_7") + "</td><td>" + compute("IM_8") + "</td><td>" + compute("IM_9") + "</td>    <td>" + compute("IM_10") + "</td><td>" + compute("IM_11") + "</td><td>" + compute("IM_12") + "</td><td>" + compute("IM_13") + "</td></tr>";
        //$("tabEditFrmMain").append(trlist);
        $("#tdmain1").html(compute("IM_1"));
        $("#tdmain2").html(compute("IM_2"));
        $("#tdmain3").html(compute("IM_3"));
        $("#tdmain4").html(compute("IM_4"));
        $("#tdmain5").html(compute("IM_5"));
        $("#tdmain6").html(compute("IM_6"));
        $("#tdmain7").html(compute("IM_7"));
        $("#tdmain8").html(compute("IM_8"));
        $("#tdmain9").html(compute("IM_9"));
        $("#tdmain10").html(compute("IM_10"));
        $("#tdmain11").html(compute("IM_11"));
        $("#tdmain12").html(compute("IM_12"));
        $("#tdmain13").html(compute("IM_13"));
        function compute(colName) {
            var rows = $('#tabEditFrmMain').datagrid('getRows');
            var total = 0;
            for (var i = 0; i < rows.length; i++) {
                if (rows[i][colName] != null && rows[i][colName] != "") {
                    total += parseFloat(rows[i][colName]);
                }
            }
            return total;
        }
    });
  

</script>
